﻿#region Using directives

using System;
using System.Collections;
using System.Data;
using UFSoft.UBF.UI.MD.Runtime;
using UFSoft.UBF.UI.MD.Runtime.Implement;

#endregion

namespace UFIDA.U9.CUST.AITShipBListUIModel
{
	[Serializable]
	public partial class AITShipBListUIModelModel : UIModel
	{
		#region Constructor
		public AITShipBListUIModelModel() : base("AITShipBListUIModel")
		{
			InitClass();
			this.SetResourceInfo("1b4fe6d5-dcad-47db-8152-154e6f55c73f");
            try{
			    AfterInitModel();
            }catch(Exception exception){
              IUIModel model = this;
		      this.ErrorMessage.SetErrorMessage(ref model,exception);
			}
		}

		//just for Clone 
		private AITShipBListUIModelModel(bool isInit) : base("AITShipBListUIModel")
		{}
		protected override IUIModel CreateCloneInstance()
		{
			return new AITShipBListUIModelModel(false);
		}
		#endregion
		#region member
		#region views
		private ShipView viewShip;			
		#endregion
		
		#region links
		#endregion
		
		#region properties
		#endregion
		#endregion

		#region property
		public ShipView Ship
		{
			get { return (ShipView)this["Ship"]; }
		}
		
		#region RealViews
		#endregion
		
	
		#endregion

		#region function
		private void InitClass()
		{
			this.viewShip = new ShipView(this);
			this.viewShip.SetResourceInfo("35c792d0-fa9e-4baf-9ed4-eee294d2c546");
			this.Views.Add(this.viewShip);			

			
		}

		public override string AssemblyName
		{
			get { return "UFIDA.U9.CUST.AITBarCodeUI"; }
		}
		
		#endregion
		private void OnValidate_DefualtImpl()
    {
    }

	}


	[Serializable]
	public partial class ShipView : UIView
	{
		#region Constructor
		public ShipView(IUIModel model) : base(model,"Ship","UFIDA.U9.SM.Ship.Ship", true)
		{
			InitClass();
		}
		//构造空实例,不进行初始化.目前为Clone使用.
		private ShipView():base(null,"Ship","UFIDA.U9.SM.Ship.Ship", true)
		{
		}
		protected override IUIView CreateCloneInstance()
		{
			return new ShipView();
		}
		#endregion

		#region fiels property filter
		public IUIField FieldID
		{
			get { return this.Fields["ID"]; }
		}


		#endregion

		#region Init
		private void InitClass()
		{
			UIModelRuntimeFactory.AddNewUIField(this,"ID", typeof(Int64), false,"","System.Int64", "ID", true,true, false, "",false,(UIFieldType)1,"ba391065-6c27-4c82-acc8-b52b1c93a910","d62e32c6-c3d7-4819-903f-649c63fc20f4");


		}
		#endregion
		
		#region override method
		protected override IUIRecord BuildNewRecord(IUIRecordBuilder builder)
		{
			return new ShipRecord(builder);
		}
		#endregion

		#region new method
		public new ShipRecord FocusedRecord
		{
			get { return (ShipRecord)base.FocusedRecord ; }
			set { base.FocusedRecord = value ; }
		}
		public new ShipRecord AddNewUIRecord()
		{	
			return (ShipRecord)base.AddNewUIRecord();
		}
		public new ShipRecord NewUIRecord()
		{	
			return (ShipRecord)base.NewUIRecord();
		}
		#endregion 

	}

	[Serializable]
	public class ShipRecord : UIRecord
	{
		#region Constructor
		public ShipRecord(IUIRecordBuilder builder):base(builder)
		{
		}
		private ShipView uiviewShip
		{
			get { return (ShipView)this.ContainerView; }
		}
		protected override IUIRecord CreateCloneInstance(IUIRecordBuilder builder)
		{
			return new ShipRecord(builder);
		}
		#endregion

		#region property
		
		
		public  Int64 ID
		{
			get{
				//object value = this[this.uiviewShip.FieldID] ;
				//return (Int64)value;
				return GetValue<Int64>(this.uiviewShip.FieldID);
			}
			set{
				this[this.uiviewShip.FieldID] = value;
			}
		}
		#endregion
	}
	



}